package com.wen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wen.pojo.OrderDetails;
import com.wen.pojo.dto.OrderDetailsDto;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderDetailsMapper extends BaseMapper<OrderDetails> {

    @Select("SELECT * FROM orders o,`order_details` ob,`product` p WHERE o.`order_id` = ob.`orders_id` AND ob.`product_id` = p.`product_id` AND ob.orders_id = #{id}")
    List<OrderDetailsDto> selById(String id);

    @Select("SELECT * FROM orders o,`order_details` ob,`product` p WHERE o.`order_id` = ob.`orders_id` AND ob.`product_id` = p.`product_id` AND ob.id = #{id}")
    OrderDetailsDto selId(String id);

}
